# 线程
'''
    线程状态
        新建 就绪 运行 阻塞 结束

'''
from threading import Thread
from time import sleep


def download(n):
    images = ["1.jpg", '2.jpg', '3.jpg']
    for image in images:
        print("正在下载", image)
        sleep(n)
        print('下载{}成功'.format(image))


def listen_music(n):
    images = ["aaa.jpg", 'bbbb.jpg', 'ccc.jpg']
    for image in images:
        print("正在听歌", image)
        sleep(n)
        print('听歌{}成功'.format(image))


if __name__ == '__main__':
    t = Thread(target=download, args=(1,))
    t.start()
    t1 = Thread(target=listen_music, args=(0.5,))
    t1.start()

    n = 1
    while True:
        print('------>', n)
        sleep(0.1)
        if n == 50:
            break
        n += 1
